/*
package com.shk.service.imp;

import com.alibaba.dubbo.config.annotation.Service;
import com.shk.dao.SetmealDao;
import com.shk.pojo.Setmeal;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.io.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class FtlHtml {

    private SetmealDao setmealDao;

    private FreeMarkerConfigurer freeMarkerConfigurer;


    private String outPutPath;
    */
/*调用方法*//*


    public void generateMobileStaticHtml() throws Exception {
        List<Setmeal> list = setmealDao.findStaticAll();
        generateMobileSetmealListHtml(list);
        generateMobileSetmealHtml(list);
    }
    */
/*套餐列表的静态页面*//*

    public void generateMobileSetmealListHtml(List<Setmeal> list) throws Exception {
        Map map=new HashMap();
        map.put("setmealList",list);
        generalHtml("mobile_setmeal.ftl","m_setmeal.html",map);
    }

    */
/*套餐详情页面  有个套餐一个详情页面 有多个*//*

    public void generateMobileSetmealHtml(List<Setmeal> list) throws Exception {
        if(list!=null){
            for(Setmeal setmeal:list){
                Map map = new HashMap();
                map.put("setmeal",map);
                generalHtml("m_setmeal_detail.ftl","m_setmeal_detail"+setmeal.getId()+".html",map);
            }
        }

    }
    */
/*通用模板*//*

    public void generalHtml(String templateName,String htmlName,Map map) throws Exception {

        Configuration configuration = freeMarkerConfigurer.getConfiguration();
            Writer writer=null;
        try {
            Template template = configuration.getTemplate(templateName);
            File file = new File(outPutPath + "/" + htmlName);
             writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file)));

            template.process(map,writer);
            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (TemplateException e) {
            e.printStackTrace();
        }


    }

}
*/
